package com.qeegoo.b2bautozityp.moudle.goods.viewmodel;

//┏┓　　　┏┓ 
//┏┛┻━━━┛┻┓ 
//┃　　　　　　　┃ 　 
//┃　　　━　　　┃ 
//┃　┳┛　┗┳　┃ 
//┃　　　　　　　┃ 
//┃　　　┻　　　┃ 
//┃　　　　　　　┃ 
//┗━┓　　　┏━┛ 
//┃　　　┃  神兽保佑　　　　　　　　 
//┃　　　┃  代码无BUG！ 
//┃　　　┗━━━┓ 
//┃　　　　　　　┣┓ 
//┃　　　　　　　┏┛ 
//┗┓┓┏━┳┓┏┛ 
// ┃┫┫　┃┫┫ 
// ┗┻┛　┗┻┛

import android.databinding.ObservableField;
import android.view.View;

import com.kelin.mvvmlight.command.ReplyCommand;
import com.qeegoo.b2bautozityp.api.HttpParams;
import com.qeegoo.b2bautozityp.api.RequestApi;
import com.qeegoo.b2bautozityp.api.entity.HttpResult;
import com.qeegoo.b2bautozityp.moudle.goods.model.GoodsManagerBean;
import com.qeegoo.b2bautozityp.utils.AdapterInterface;

import base.lib.util.ActivityManager;
import rx.Observable;

/**
 * Created by lk on 2017/9/28.
 */

public class GoodsSearchViewModel {
    public final RequestApi requestApi;
    public ObservableField<Integer> emptyVisible = new ObservableField<>(View.VISIBLE);
    private AdapterInterface<GoodsManagerBean> adapterInterface;
    public ReplyCommand leftCommon = new ReplyCommand(() -> {
        ActivityManager.getActivity().finish();
    });

    public ReplyCommand rightCommon = new ReplyCommand(() -> {


    });
    public ObservableField<String> leftText = new ObservableField<>("");
    public GoodsSearchViewModel(RequestApi api) {
        this.requestApi = api;
    }

    public void setAdapterInterface(AdapterInterface<GoodsManagerBean> orderResultBeanAdapterInterface) {
        this.adapterInterface = orderResultBeanAdapterInterface;
    }

    public Observable<HttpResult<GoodsManagerBean>> getData(String words){
        return requestApi.goodsList(HttpParams.paramGoodsLists("1", "50", "0", words));
    }
}
